package com.xiaoyu.im.provider;

import java.util.Collections;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

public class MessageStatusProcessor {

    private static MessageStatusProcessor INSTANCE = new MessageStatusProcessor();

    private final Set<String> mSendingSet = Collections.newSetFromMap(new ConcurrentHashMap<>());

    public static MessageStatusProcessor getInstance() {
        return INSTANCE;
    }

    public void addSending(String localId) {
        mSendingSet.add(localId);
    }

    public void removeSending(String localId) {
        mSendingSet.remove(localId);
    }

    public boolean isSending(String localId) {
        return mSendingSet.contains(localId);
    }
}
